home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 2 / Gold Medal Software Volume 2 (Gold Medal) (1994).iso / prog / bozol2.arj / FLOW.CMD < prev    next >
OS/2 REXX Batch file  |  1993-10-25  |  1KB  |  38 lines

  1.  
  2.         CASE "GOTO"
  3.                 ' if it's a number goto the literal line number otherwise
  4.                 ' try to find a label matching the name of what was pushed.
  5.             A$=POPARG$
  6.                 IF VAL(A$) THEN
  7.                     ProgLine%=VAL(A$)-1
  8.         ELSE
  9.                     ARRAY SCAN PROGRAM$(), FROM 1 TO LEN(LITERAL$(1)),_
  10.                      COLLATE UCASE, =LITERAL$(1), TO ProgLine%
  11.                         DECR ProgLine%
  12.                 END IF
  13.                 IF ProgLine%<1 OR ProgLine%>1000 THEN ERROR 100
  14.  
  15.         CASE "TO", "IN", "WITH", "IS", "BE", "EQUAL", "OF", "THE", "AT"
  16.         ' do nothing, these are spacers.
  17.  
  18.         CASE "GOSUB"
  19.             INCR GosubPtr%
  20.                 GosubStack%(GosubPtr%)=ProgLine%
  21.  
  22.             A$=POPARG$
  23.  
  24.                 IF VAL(A$) THEN
  25.                     ProgLine%=VAL(A$)-1
  26.         ELSE
  27.                     ARRAY SCAN PROGRAM$(), FROM 1 TO LEN(LITERAL$(1)),_
  28.                      COLLATE UCASE, =LITERAL$(1), TO ProgLine%
  29.                     DECR ProgLine%
  30.                 END IF
  31.  
  32.                 IF ProgLine%<1 OR ProgLine%>1000 THEN ERROR 100
  33.  
  34.     CASE "RETURN"
  35.             ProgLine%=GosubStack%(GosubPtr%)
  36.                 DECR GosubPtr%
  37.                 IF ProgLine%=0 OR ProgLine%>1000 THEN ERROR 100
  38.